import random

from matplotlib import pyplot as plt

from matplotlib import font_manager


my_font = font_manager.FontProperties(fname="STSONG.TTF")

y = [random.randint(0,6) for i in range(20)]
x = [j for j in range(11,31)]
plt.figure(figsize=(20,8),dpi=80)

plt.plot(x,y,label="啊啊")


# plt.scatter()
x1 = ["%d岁"%(k) for k in x]
plt.xticks(x,x1,font_properties=my_font)
plt.xlabel("年龄",font_properties=my_font)
plt.ylabel("个数",font_properties=my_font)
plt.title("年龄的个数变化 单位个",font_properties=my_font)
plt.grid()



plt.legend(prop=my_font)
plt.show()